<template>
	<view class="flex-col page">


		<!-- 自定义导航栏 -->
		<u-navbar leftIconColor='#282C35' title="申请加入" titleStyle='font-weight:bold;' bgColor='transparent'
			:autoBack="true">
		</u-navbar>
		<view class="flex-col">
			<view class="flex-row items-end section_2">
				<view class="flex-col">
					<view class="flex-col self-stretch group_2">
						<view class="flex-row items-center self-stretch group_3">
							<image v-if="validateStep(0)" style="width: 32rpx;height: 32rpx;" class="shrink-0 image_6"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901948816851390.png" />
							<image v-else style="width: 28rpx;height: 28rpx;" class="shrink-0 image_6"
								src="https://yjgs.jsonbug.com/storage/default/20250312/yuanhuang.png" />
							<text class="font" :class="[currentStep >= 0 ? 'text_active' : 'text_3']"
								@click="switchStep(0)">申请信息</text>

							<image v-if="validateStep(1)" style="width: 32rpx;height: 32rpx;"
								class="shrink-0 image_6 image_7"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901948816851390.png" />
							<image v-else style="width: 28rpx;height: 28rpx;" class="shrink-0 image_6 image_7"
								src="https://yjgs.jsonbug.com/storage/default/20250312/yuanhuang.png" />
							<text class="font" :class="[currentStep >= 1 ? 'text_active' : 'text_4']"
								@click="switchStep(1)">单位信息</text>

							<image v-if="validateStep(2)" class="shrink-0 image_6 image_7"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901948816851390.png" />
							<image v-else style="width: 28rpx;height: 28rpx;" class="shrink-0 image_6 image_7"
								src="https://yjgs.jsonbug.com/storage/default/20250312/yuanhuang.png" />
							<text class="font" :class="[currentStep >= 2 ? 'text_active' : 'text_4']"
								@click="switchStep(2)">会员代表信息</text>

							<image v-if="validateStep(3)" class="shrink-0 image_6 image_7"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901948816851390.png" />
							<image v-else style="width: 28rpx;height: 28rpx;" class="shrink-0 image_6 image_7"
								src="https://yjgs.jsonbug.com/storage/default/20250312/yuanhuang.png" />
							<text class="font" :class="[currentStep >= 3 ? 'text_active' : 'text_4']"
								@click="switchStep(3)">联系人信息</text>

						</view>
						<view class="indicator-container">
							<!-- 自定义指示器，不使用图片 -->
							<view class="indicator-line"
								:style="{ left: indicatorPosition + 'rpx', width: indicatorWidth + 'rpx' }">
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="flex-col section_6" v-if="currentStep === 0">
				<view class="flex-row items-center group_4">
					<image class="image_9"
						src="https://yjgs.jsonbug.com/storage/default/20241224/17421781799983824908.png" />
					<text class="font_2 text_7 ml-6-5">申请信息</text>
				</view>
				<view class="flex-col group_5">
					<view class="flex-row justify-between items-center section_7 view">
						<view class="group_7">
							<text class="font_3">*</text>
							<text class="font_4 text_8">申请职务</text>
						</view>
						<view class="flex-row items-center p-20 bb" style="background-color: #F2F2F2;">
							<picker @change="onPositionChange" :value="positionIndex" :range="positionList"
								range-key="name">
								<view class="flex-row items-center">
									<text
										class="font_5 text_9">{{ selectedPosition ? selectedPosition.name : '请选择申请职务' }}</text>
									<image class="ml-36 shrink-0 image_10"
										src="https://yjgs.jsonbug.com/storage/default/20241224/17421901952033913785.png" />
								</view>
							</picker>
						</view>
					</view>
					<view class="flex-row justify-between items-center section_8">
						<text class="font_4 text_10">需求资源</text>
						<view class="flex-row items-center group_8" @click="showAddResourceDialog('需求资源')">
							<image class="shrink-0 image_10"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901954344150597.png" />
							<text class="font_6 text_11 ml-5-5">添加</text>
						</view>
					</view>
					<view class="flex-col justify-start section_9">
						<view class="section_10 view_2">
							<view v-if="requiredResources.length > 0" class="resource-tags">
								<view v-for="(item, index) in requiredResources" :key="index" class="resource-tag">
									<text>{{item}}</text>
									<text class="delete-icon" @click="deleteResource('需求资源', index)">×</text>
								</view>
							</view>
							<view v-else class="empty-resource-hint">
								<text>暂无需求资源，请点击右上角"添加"按钮添加</text>
							</view>
						</view>
					</view>
					<view class="flex-row justify-between items-center section_8">
						<text class="font_2 text_12">可提供的资源</text>
						<view class="flex-row items-center group_8" @click="showAddResourceDialog('可提供的资源')">
							<image class="shrink-0 image_10"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901954344150597.png" />
							<text class="font_6 text_11 ml-5-5">添加</text>
						</view>
					</view>
					<view class="flex-col section_11">
						<view class="self-stretch section_10">
							<view v-if="providedResources.length > 0" class="resource-tags">
								<view v-for="(item, index) in providedResources" :key="index" class="resource-tag">
									<text>{{item}}</text>
									<text class="delete-icon" @click="deleteResource('可提供的资源', index)">×</text>
								</view>
							</view>
							<view v-else class="empty-resource-hint">
								<text>暂无可提供资源，请点击右上角"添加"按钮添加</text>
							</view>
						</view>
						<text class="self-start text_13 mt-5">例：xx人脉 、xx业务 、xx渠道 、xx供应链等资源</text>
					</view>
				</view>
			</view>
			<view class="flex-col section_6" v-if="currentStep === 1">
				<view class="flex-row items-center self-start group_4">
					<image class="shrink-0 image_9"
						src="https://yjgs.jsonbug.com/storage/default/20241224/17421781799983824908.png" />
					<text class="font_2 text_7 ml-6-5">单位信息</text>
				</view>
				<view class="self-stretch divider_2"></view>
				<view class="flex-col self-stretch group_9">
					<view class="flex-col view view_3">
						<view class="self-start group_10">
							<text class="font_3">*</text>
							<text class="font_4 text_14">单位名称</text>
						</view>
						<view class="flex-col justify-start items-start self-stretch  mt-13 p-10"
							style="background-color: #F2F2F2;">
							<u-input v-model="companyName" placeholder="请输入单位名称" :border="false"
								:customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
					<view class="flex-row justify-between items-center section_7 view_4">
						<view class="group_11">
							<text class="font_7">*</text>
							<text class="font_4 text_16">单位类别</text>
						</view>
						<view class="flex-row items-center p-20  bb" style="background-color: #F2F2F2;">
							<picker @change="onCompanyTypeChange" :value="companyTypeIndex" :range="companyTypeList"
								range-key="name">
								<view class="flex-row items-center">
									<text
										class="font_5">{{ selectedCompanyType ? selectedCompanyType.name : '请选择单位类型' }}</text>
									<image class="ml-36 shrink-0 image_10"
										src="https://yjgs.jsonbug.com/storage/default/20241224/17421901952033913785.png" />
								</view>
							</picker>
						</view>
					</view>
					<view class="flex-row justify-between items-center section_8">
						<view class="group_12">
							<text class="font_7">*</text>
							<text class="font_2">所属行业</text>
						</view>
						<view class="flex-row items-center group_8"
							@tap="() => { this.activeTab = 0; this.currentSecondLevelOptions = this.industryList[this.industryIndexes[0]].children; this.tempSelectedIndustries = this.selectedIndustryData ? [...this.selectedIndustryData] : []; this.showIndustryDialog = true; }">
							<image class="shrink-0 image_10"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901954344150597.png" />
							<text class="font_6 text_11 ml-5-5">选择</text>
						</view>
					</view>
					<view class="flex-col justify-start section_9">
						<view class="section_12">
							<view v-if="selectedIndustry && selectedIndustryData && selectedIndustryData.length > 0"
								class="resource-tags">
								<view v-for="(item, index) in selectedIndustryData" :key="index" class="resource-tag">
									<text>{{getFullIndustryName(item)}}</text>
									<text class="delete-icon" @click="removeSelectedIndustry(index)">×</text>
								</view>
							</view>
							<view v-else class="empty-resource-hint">
								<text>暂无所属行业，请点击右上角"选择"按钮选择</text>
							</view>
						</view>
					</view>

					<view class="flex-row justify-between items-center section_8 mb-20">
						<view class="group_12">
							<text class="font_7">*</text>
							<text class="font_2">主营业务</text>
						</view>
						<view class="flex-row items-center group_8" @click="showAddResourceDialog('主营业务')">
							<image class="shrink-0 image_10"
								src="https://yjgs.jsonbug.com/storage/default/20241224/17421901954344150597.png" />
							<text class="font_6 text_11 ml-5-5">添加</text>
						</view>
					</view>
					<view class="flex-col justify-start section_9">
						<view class="section_12">
							<view v-if="mainBusinesses.length > 0" class="resource-tags">
								<view v-for="(item, index) in mainBusinesses" :key="index" class="resource-tag">
									<text>{{item}}</text>
									<text class="delete-icon" @click="deleteResource('主营业务', index)">×</text>
								</view>
							</view>
							<view v-else class="empty-resource-hint">
								<text>暂无主营业务，请点击右上角"添加"按钮添加</text>
							</view>
						</view>
					</view>
					<view class="flex-col items-start group_13">
						<view class="group_14 view_5">
							<text class="font_3">*</text>
							<text class="font_2 text_17">营业执照</text>
						</view>
						<view class="license-upload-container mt-13-5">
							<image v-if="licenseImage" class="image_11" :src="licenseImage" mode="aspectFill"
								@click="previewImage(licenseImage)" />
							<view v-else class="license-upload-btn" @click="uploadLicense">
								<u-icon name="camera-fill" size="50" color="#999"></u-icon>
								<text class="upload-text">点击上传营业执照</text>
							</view>
							<view v-if="licenseImage" class="delete-btn" @click.stop="deleteLicense">
								<u-icon name="close-circle-fill" size="30" color="#ff0000"></u-icon>
							</view>
						</view>
					</view>
					<view class="flex-row justify-between section_7">
						<view class="self-start group_16">
							<text class="font_3">*</text>
							<text class="font_2 text_18">注册时间</text>
						</view>
						<view class="flex-row self-center p-20 bb" style="background-color: #F2F2F2;">
							<picker mode="date" @change="onRegisterDateChange" :value="registerDate">
								<view class="flex-row items-center justify-between" style="width: 100%;">
									<text class="font text_19">{{ registerDate || '请选择注册时间' }}</text>
									<image class="ml-60 shrink-0 image_12"
										src="https://yjgs.jsonbug.com/storage/default/20241224/d4063a37e9f3c18a5f3a4342af2038a8.png" />
								</view>
							</picker>
						</view>
					</view>
				</view>
			</view>
			<view class="flex-col section_13" v-if="currentStep === 2">
				<view class="flex-row items-center group_4">
					<image class="image_9"
						src="https://yjgs.jsonbug.com/storage/default/20241224/17421781799983824908.png" />
					<text class="font_2 text_20 ml-5-5">会员代表信息</text>
				</view>
				<view class="divider"></view>
				<view class="flex-col group_17">
					<view class="flex-row justify-between items-center section_7 view_6">
						<view class="group_18">
							<text class="font_3">*</text>
							<text class="font_4 text_21">姓名</text>
						</view>
						<view class="flex-col justify-start items-start p-10 bb" style="background-color:#F2F2F2 ;">
							<u-input v-model="memberName" placeholder="请输入姓名" :border="false"
								:customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
					<view class="flex-row justify-between items-center section_7 view_7">
						<view class="group_19">
							<text class="font_3">*</text>
							<text class="font_4 text_23">单位职务</text>
						</view>
						<view class="flex-col justify-start items-start p-10 bb" style="background-color:#F2F2F2 ;">
							<u-input v-model="memberPosition" placeholder="例：董事长、总经理" :border="false"
								:customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
					<view class="flex-row justify-between items-center section_7">
						<view class="group_12">
							<text class="font_3">*</text>
							<text class="font_2">性别</text>
						</view>
						<view class="flex-row items-center justify-end group_20"
							style="width: 351rpx; height: 61rpx; padding: 0 20rpx;">
							<u-radio-group v-model="memberGender" activeColor="#2a82e4"
								:customStyle="{display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'center'}">
								<u-radio label="男" name="男" :labelSize="16" :iconSize="16"
									:customStyle="{marginRight: '60rpx'}"></u-radio>
								<u-radio label="女" name="女" :labelSize="16" :iconSize="16"></u-radio>
							</u-radio-group>
						</view>
					</view>
					<view class="flex-row justify-between items-center section_7 view_8">
						<view class="group_23">
							<text class="font_9">*</text>
							<text class="font_4 text_27">手机号码</text>
						</view>
						<view class="flex-col justify-start items-start p-10 bb" style="background-color:#F2F2F2 ;">
							<u-input v-model="memberPhone" placeholder="请输入手机号" type="number" maxlength="11"
								:border="false" :customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
					<view class="flex-row justify-between items-center section_7 view_9">
						<view class="group_19">
							<text class="font_9">*</text>
							<text class="font_4 text_23">籍贯</text>
						</view>
						<view class="flex-col justify-start items-center p-15 bb"
							style="background-color:#F2F2F2;width: 390rpx;">
							<picker @change="onHomeTownChange" :value="homeTownIndex" :range="provinceList">
								<view class="flex-row items-center justify-between" style="width: 100%;">
									<text class="font_8">{{ selectedProvince || '---请选择---' }}</text>
									<image class="shrink-0 image_10"
										src="https://yjgs.jsonbug.com/storage/default/20241224/17421901952033913785.png" />
								</view>
							</picker>
						</view>
					</view>
					<view class="flex-col items-start group_13">
						<view class="group_14 view_10">
							<text class="font_3">*</text>
							<text class="font_2">头像风采照</text>
						</view>
						<view class="position-relative">
							<image class="image_13 mt-13-5"
								:src="avatarImage || 'https://yjgs.jsonbug.com/storage/default/20241224/17421908598592735808.png'"
								@click="uploadAvatar" mode="aspectFill" />
							<view v-if="avatarImage" class="delete-btn" @click.stop="deleteAvatar">
								<u-icon name="close-circle-fill" size="30" color="#ff0000"></u-icon>
							</view>
						</view>
					</view>
					<view class="flex-row justify-between items-center section_7">
						<view class="group_24">
							<text class="font_3">*</text>
							<text class="font_2 text_29">证件号码</text>
						</view>
						<view class="flex-col justify-start items-start p-10 bb" style="background-color:#F2F2F2 ;">
							<u-input v-model="memberIdCard" placeholder="请输入证件号码" maxlength="18" :border="false"
								:customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
					<view class="flex-col section_14">
						<view class="self-start group_25">
							<text class="font_3 text_31">*</text>
							<text class="font_2 text_32">上传证件照</text>
						</view>
						<view class="flex-row equal-division mt-13-5">
							<view
								class="flex-col justify-start items-center image-wrapper_2 equal-division-item position-relative">
								<image class="shrink-0 image_14"
									:src="idCardFrontImage || 'https://yjgs.jsonbug.com/storage/default/20241224/091fef790c4f41a80a5766c418562138.png'"
									@click="uploadIdCardFront" mode="aspectFill" />
								<view v-if="idCardFrontImage" class="delete-btn" @click.stop="deleteIdCardFront">
									<u-icon name="close-circle-fill" size="30" color="#ff0000"></u-icon>
								</view>
							</view>
							<view
								class="ml-10 flex-col justify-start items-center image-wrapper_2 equal-division-item position-relative">
								<image class="shrink-0 image_14"
									:src="idCardBackImage || 'https://yjgs.jsonbug.com/storage/default/20241224/c31678261bdea5822051d5d2423428af.png'"
									@click="uploadIdCardBack" mode="aspectFill" />
								<view v-if="idCardBackImage" class="delete-btn" @click.stop="deleteIdCardBack">
									<u-icon name="close-circle-fill" size="30" color="#ff0000"></u-icon>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="flex-col section_15" v-if="currentStep === 3">
				<view class="flex-row items-center">
					<view class="section_16"></view>
					<text class="font_2 text_33 ml-5-5">联系人信息</text>
				</view>
				<view class="flex-col mt-8-5">
					<view class="flex-row justify-between section_17">
						<text class="self-start font_2 text_34 text_35">
							<!-- <text class="c-red">*</text> -->
							姓名</text>
						<view class="flex-col justify-start items-start self-center p-10 bb"
							style="background-color:#F2F2F2 ;">
							<u-input v-model="contactName" placeholder="请输入姓名" :border="false"
								:customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
					<view class="flex-row justify-between section_17">
						<text class="self-start font_2 text_34 text_37">
							<!-- <text class="c-red">*</text> -->
							手机号码</text>
						<view class="flex-col justify-start items-start self-center p-10 bb"
							style="background-color:#F2F2F2 ;">
							<u-input v-model="contactPhone" placeholder="请输入手机号" type="number" maxlength="11"
								:border="false" :customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
					<view class="flex-row justify-between section_17">
						<text class="self-start font_2 text_34 text_39">
							<!-- <text class="c-red">*</text> -->
							单位职务</text>
						<view class="flex-col justify-start items-start self-center p-10 bb"
							style="background-color:#F2F2F2 ;">
							<u-input v-model="contactPosition" placeholder="例：董事长、总经理" :border="false"
								:customStyle="{padding: '0 20rpx', height: '100%', width: '100%'}" />
						</view>
					</view>
				</view>
			</view>

			<view class="p-20">
				<view class="audit-status-container">
					<view v-if="status == 1" class="audit-status-box audit-pass">
						<view class="status-icon">
							<u-icon name="checkmark-circle" color="#19be6b" size="48"></u-icon>
						</view>
						<view class="status-content">
							<view class="status-title">审核通过</view>
							<view class="status-desc">您的入会申请已通过审核</view>
						</view>
					</view>

					<view v-if="status == 2" class="audit-status-box audit-reject">
						<view class="status-icon">
							<u-icon name="close-circle" color="#fa3534" size="48"></u-icon>
						</view>
						<view class="status-content">
							<view class="status-title">审核驳回</view>
							<view class="status-desc">您的入会申请未通过审核</view>
							<view v-if="remark" class="reject-reason">
								<view class="reason-title">驳回理由：</view>
								<view class="reason-content">{{remark}}</view>
							</view>
						</view>
					</view>

					<view v-if="status == 3" class="audit-status-box audit-pending">
						<view class="status-icon">
							<u-icon name="hourglass" color="#ff9900" size="48"></u-icon>
						</view>
						<view class="status-content">
							<view class="status-title">审核中</view>
							<view class="status-desc">您的入会申请正在审核中，请耐心等待</view>
						</view>
					</view>

					<view v-if="!status" class="audit-status-box no-submit">
						<view class="status-icon">
							<u-icon name="info-circle" color="#909399" size="48"></u-icon>
						</view>
						<view class="status-content">
							<view class="status-title">未提交</view>
							<view class="status-desc">请填写完善信息后提交审核</view>
						</view>
					</view>
				</view>
			</view>

		</view>
		<view class="flex-row justify-center section_18 safe-area-bottom">
			<view class="flex-col justify-start items-center text-wrapper_4" @click="saveToCache"><text
					class="font_10 text_41">暂存</text>
			</view>
			<view v-if="currentStep > 0" class="flex-col justify-start items-center text-wrapper_5 ml-21-5"
				@click="prevStep">
				<text class="font text_42">上一步</text>
			</view>
			<view class="flex-col justify-start items-center text-wrapper_6 ml-21-5" @click="nextStep">
				<text class="font_10 text_43">{{ currentStep === 3 ? '提交审核' : '下一步' }}</text>
			</view>
		</view>

		<!-- 添加资源弹窗 -->
		<u-popup :show="showResourceDialog" mode="center" @close="cancelAddResource" :closeOnClickOverlay="true"
			:round="10" :customStyle="{width: '600rpx', padding: '0rpx'}">
			<view class="resource-dialog">
				<view class="resource-dialog-title">
					<text>添加{{currentResourceType}}</text>
				</view>
				<view class="resource-dialog-content">
					<u-input v-model="resourceInput" placeholder="请输入内容" :border="false"
						:customStyle="{padding: '10rpx 20rpx', backgroundColor: '#f8f8f8', borderRadius: '6rpx', width: '100%'}" />
				</view>
				<view class="resource-dialog-footer">
					<view class="resource-dialog-btn cancel-btn" @click="cancelAddResource">
						<text>取消</text>
					</view>
					<view class="resource-dialog-btn confirm-btn" @click="confirmAddResource">
						<text>确定</text>
					</view>
				</view>
			</view>
		</u-popup>

		<!-- 行业选择弹窗 -->
		<u-popup :safeAreaInsetBottom="false" :show="showIndustryDialog" mode="center" @close="cancelIndustrySelector"
			:closeOnClickOverlay="true" :round="10"
			:customStyle="{width: '660rpx', height: 'auto', padding: '0rpx', maxHeight: '80%', borderRadius: '16rpx'}">
			<view class="industry-dialog">
				<view class="industry-dialog-title">
					<text class="title-text">选择所属行业</text>
					<text class="title-desc">（最多选3个）</text>
				</view>
				<view class="industry-dialog-content">
					<view class="industry-tabs">
						<view class="industry-tab" :class="{'industry-tab-active': activeTab === 0}"
							@click="switchTab(0)">
							<text>一级行业</text>
						</view>
						<view class="industry-tab" :class="{'industry-tab-active': activeTab === 1}"
							@click="switchTab(1)">
							<text>二级行业</text>
						</view>
					</view>
					<scroll-view scroll-y class="industry-scroll">
						<!-- 一级行业列表 -->
						<view class="industry-list" v-if="activeTab === 0">
							<view v-for="(industry, index) in industryList" :key="index" class="industry-item"
								hover-class="industry-item-hover" @click="selectFirstLevelIndustry(industry, index)">
								<view class="industry-item-left">
									<text class="industry-name">{{industry.name}}</text>
								</view>
								<view class="industry-item-right">
									<u-icon name="arrow-right" color="#CCCCCC" size="28"></u-icon>
								</view>
							</view>
						</view>
						<!-- 二级行业列表 -->
						<view class="industry-list" v-if="activeTab === 1">
							<view v-for="(industry, index) in currentSecondLevelOptions" :key="index"
								class="industry-item" hover-class="industry-item-hover"
								@click="toggleIndustrySelection(industry)">
								<view class="industry-item-left">
									<view class="industry-checkbox"
										:class="{'industry-checkbox-selected': isIndustrySelected(industry)}">
										<text v-if="isIndustrySelected(industry)" class="check-icon">✓</text>
									</view>
									<text class="industry-name">{{industry.name}}</text>
								</view>
							</view>
						</view>
					</scroll-view>
					<!-- 已选行业标签 -->
					<view class="selected-industries-container" v-if="tempSelectedIndustries.length > 0">
						<view class="selected-industries-title">
							<text>已选择 ({{tempSelectedIndustries.length}}/3)</text>
						</view>
						<scroll-view scroll-y class="selected-industries-scroll">
							<view class="selected-industries-tags">
								<view v-for="(item, index) in tempSelectedIndustries" :key="index"
									class="selected-industry-tag">
									<text class="tag-text">{{getFullIndustryName(item)}}</text>
									<text class="delete-icon" @click.stop="removeFromTempSelected(index)">×</text>
								</view>
							</view>
						</scroll-view>
					</view>
				</view>
				<view class="industry-dialog-footer">
					<view class="industry-dialog-btn cancel-btn" hover-class="btn-hover"
						@click="cancelIndustrySelector">
						<text>取消</text>
					</view>
					<view class="industry-dialog-btn confirm-btn" hover-class="btn-hover"
						@click="confirmIndustrySelection">
						<text>确定</text>
					</view>
				</view>
			</view>
		</u-popup>


	</view>
</template>

<script>
	import {
		comPosition,
		comSaveUser,
		comUserDetail
	} from "@/api/extend.js"
	export default {
		components: {},
		props: {},
		data() {
			return {
				id: '', // 当前申请入会id
				currentStep: 0, // 当前步骤：0-申请信息，1-单位信息，2-会员代表信息，3-联系人信息
				steps: ['申请信息', '单位信息', '会员代表信息', '联系人信息'],
				// 每个步骤对应的指示线位置（固定值，调整了最后一个位置）
				indicatorPositions: [36, 190, 320, 530],
				// 每个步骤对应的指示线宽度（调整了宽度以更好地匹配文本）
				indicatorWidths: [80, 80, 110, 90],

				// 审核状态
				status: null, // 审核状态，1=通过，2=驳回，3=待审核
				remark: '', // 驳回理由

				// 申请职务相关数据
				positionIndex: 0, // 当前选中的职务索引
				selectedPosition: null, // 已选择的职务
				positionList: [],

				// 资源相关数据
				requiredResources: [], // 需求资源列表
				providedResources: [], // 可提供的资源列表
				industries: [], // 所属行业列表
				mainBusinesses: [], // 主营业务列表

				// 弹窗相关
				showResourceDialog: false, // 是否显示添加资源弹窗
				currentResourceType: '', // 当前操作的资源类型
				resourceInput: '', // 资源输入框的值

				// 单位信息相关数据
				companyName: '', // 单位名称
				companyTypeIndex: 0, // 当前选中的单位类型索引
				selectedCompanyType: null, // 已选择的单位类型
				companyTypeList: [],
				registerDate: '', // 注册时间

				// 会员代表信息
				memberName: '', // 姓名
				memberPosition: '', // 单位职务
				memberGender: '男', // 性别
				memberPhone: '', // 手机号码
				homeTownIndex: 0, // 籍贯索引
				selectedProvince: '', // 已选择的籍贯
				provinceList: [], // 省份列表
				memberIdCard: '', // 证件号码
				avatarImage: '', // 头像风采照图片路径
				idCardFrontImage: '', // 身份证人像面图片路径
				idCardBackImage: '', // 身份证国徽面图片路径

				// 联系人信息
				contactName: '', // 姓名
				contactPhone: '', // 手机号码
				contactPosition: '', // 单位职务

				// 营业执照
				licenseImage: '', // 营业执照图片路径

				// 缓存键名
				cacheKey: 'chamber_post_data',

				// 行业选择相关
				industryList: [],
				industryArray: [
					[],
					[]
				], // 二维数组，第一列是一级行业，第二列是二级行业
				industryIndexes: [0, 0], // 当前选中的行业索引
				selectedIndustry: '', // 已选择的行业显示文本
				selectedIndustryData: null, // 已选择的行业数据对象
				tempSelectedIndustries: [], // 临时选择的行业
				activeTab: 0, // 当前显示的标签页
				currentSecondLevelOptions: [], // 当前显示的二级行业选项
				showIndustryDialog: false, // 显示行业选择弹窗
			};
		},

		computed: {
			chamberObj() {
				return this.$store.state.extend.chamberObj
			},
			// 根据当前步骤计算指示线位置
			indicatorPosition() {
				return this.indicatorPositions[this.currentStep];
			},
			// 根据当前步骤计算指示线宽度
			indicatorWidth() {
				return this.indicatorWidths[this.currentStep];
			},
			// 获取所有表单数据
			formData() {
				return {
					// 申请信息
					position: this.selectedPosition ? this.selectedPosition.name : '',
					requiredResources: this.requiredResources,
					providedResources: this.providedResources,

					// 单位信息
					companyName: this.companyName,
					companyType: this.selectedCompanyType ? this.selectedCompanyType.name : '',
					industry: this.selectedIndustry,
					industryData: this.selectedIndustryData,
					mainBusinesses: this.mainBusinesses,
					licenseImage: this.licenseImage,
					registerDate: this.registerDate,

					// 会员代表信息
					memberName: this.memberName,
					memberPosition: this.memberPosition,
					memberGender: this.memberGender,
					memberPhone: this.memberPhone,
					homeTown: this.selectedProvince,
					avatarImage: this.avatarImage,
					memberIdCard: this.memberIdCard,
					idCardFrontImage: this.idCardFrontImage,
					idCardBackImage: this.idCardBackImage,

					// 联系人信息
					contactName: this.contactName,
					contactPhone: this.contactPhone,
					contactPosition: this.contactPosition
				};
			}
		},

		onLoad() {
			// 初始化时从缓存加载数据
			this.loadFromCache();
			// 初始化行业选择器数据
			this.initIndustryPicker();

			// 创建一个Promise数组来管理所有异步请求
			const promiseArray = [
				this.loadPositionData(),
				this.loadCompanyTypeData(),
				this.loadProvinceData(),
				this.loadIndustryData()
			];

			// 等待所有请求完成后再获取用户详情
			Promise.all(promiseArray).then(() => {
				console.log('所有数据加载完成，准备获取用户详情');
				this.getComUserDetail();
			}).catch(err => {
				console.error('数据加载失败', err);
			});
		},
		methods: {
			// 加载职位数据
			loadPositionData() {
				return new Promise((resolve, reject) => {
					comPosition({
						com_id: this.chamberObj.id,
						deep: 1,
						type: 1 // 申请职务
					}).then(res => {
						this.positionList = res.data.map(item => {
							return {
								...item,
								name: item.title
							}
						});
						resolve();
					}).catch(err => {
						console.error('加载职位数据失败', err);
						reject(err);
					});
				});
			},

			// 加载单位类别数据
			loadCompanyTypeData() {
				return new Promise((resolve, reject) => {
					comPosition({
						com_id: this.chamberObj.id,
						deep: 1,
						type: 3 // 单位类别
					}).then(res => {
						this.companyTypeList = res.data.map(item => {
							return {
								...item,
								name: item.title
							}
						});
						resolve();
					}).catch(err => {
						console.error('加载单位类别数据失败', err);
						reject(err);
					});
				});
			},

			// 加载籍贯数据
			loadProvinceData() {
				return new Promise((resolve, reject) => {
					comPosition({
						com_id: this.chamberObj.id,
						deep: 1,
						type: 4 // 籍贯
					}).then(res => {
						this.provinceList = res.data.map(item => {
							return item.areaName
						});
						resolve();
					}).catch(err => {
						console.error('加载籍贯数据失败', err);
						reject(err);
					});
				});
			},

			// 加载行业数据
			loadIndustryData() {
				return new Promise((resolve, reject) => {
					comPosition({
						com_id: this.chamberObj.id,
						deep: 2,
						type: 2 // 行业数据
					}).then(res => {
						this.industryList = res.data;
						console.log('行业数据加载完成', this.industryList);

						// 如果有待处理的行业ID，立即处理
						this.$nextTick(() => {
							this.processPendingIndustryIds();
						});

						resolve();
					}).catch(err => {
						console.error('加载行业数据失败', err);
						reject(err);
					});
				});
			},

			getComUserDetail() {
				console.log('开始请求用户详情数据');
				// 所有数据已加载完成，可以直接请求用户详情
				comUserDetail({
					com_id: this.chamberObj.id
				}).then(res => {
					console.log(res, '用户详情数据');
					if (res.status === 200 && res.data) {
						const data = res.data;
						this.id = data.id;

						// 设置审核状态和驳回理由
						this.status = data.status || null;
						this.remark = data.remark || '';
						console.log('审核状态:', this.status, '驳回理由:', this.remark);

						// 申请信息
						if (data.position_id) {
							// 找到对应的职位
							const posIndex = this.positionList.findIndex(item => item.id === parseInt(data
								.position_id));
							if (posIndex !== -1) {
								this.positionIndex = posIndex;
								this.selectedPosition = this.positionList[posIndex];
							}
						}

						// 需求资源和可提供的资源
						this.requiredResources = data.need ? data.need.split(',').filter(Boolean) : [];
						this.providedResources = data.supply ? data.supply.split(',').filter(Boolean) : [];

						// 单位信息
						this.companyName = data.unit || '';

						// 单位类别
						if (data.unit_industry && data.unit_industry !== '0') {

							// 使用名称进行匹配，而不是ID
							const typeIndex = this.companyTypeList.findIndex(item =>
								item.name === data.unit_industry ||
								item.title === data.unit_industry
							);

							if (typeIndex !== -1) {
								this.companyTypeIndex = typeIndex;
								this.selectedCompanyType = this.companyTypeList[typeIndex];
							} else {
								// 尝试模糊匹配
								const fuzzyIndex = this.companyTypeList.findIndex(item =>
									(item.name && item.name.includes(data.unit_industry)) ||
									(data.unit_industry.includes(item.name)) ||
									(item.title && item.title.includes(data.unit_industry)) ||
									(data.unit_industry.includes(item.title))
								);

								if (fuzzyIndex !== -1) {
									this.companyTypeIndex = fuzzyIndex;
									this.selectedCompanyType = this.companyTypeList[fuzzyIndex];
								} else {}
							}
						}

						// 所属行业
						if (data.industry_ids && data.industry_one_ids) {
							// 增加防御性检查，确保industryList已经加载完成
							if (!this.industryList || this.industryList.length === 0) {
								console.log('行业数据未加载完成，暂存待处理的行业ID');
								// 存储待处理的ID数据
								this.pendingIndustryIds = data.industry_ids;
								this.pendingIndustryOneIds = data.industry_one_ids;
								return;
							}

							// 将返回的ID转为数组
							const industryIds = data.industry_ids.split(',').map(id => parseInt(id));
							const industryOneIds = data.industry_one_ids.split(',').map(id => parseInt(id));

							// 临时存储选中的行业
							let tempSelectedIndustries = [];

							// 遍历一级行业ID
							industryOneIds.forEach(parentId => {
								// 找到对应的一级行业
								const parentIndustry = this.industryList.find(industry => industry.id ===
									parentId);

								if (parentIndustry && parentIndustry.children) {
									// 遍历二级行业ID
									industryIds.forEach(childId => {
										// 在该一级行业的子行业中查找
										const childIndustry = parentIndustry.children.find(child =>
											child.id === childId);

										if (childIndustry) {
											// 构建完整的行业数据
											tempSelectedIndustries.push({
												...childIndustry,
												parentId: parentIndustry.id,
												parentName: parentIndustry.name
											});
										}
									});
								}
							});

							// 更新选中的行业数据
							this.selectedIndustryData = tempSelectedIndustries;

							// 更新显示文本
							if (tempSelectedIndustries.length > 0) {
								this.selectedIndustry = tempSelectedIndustries
									.map(industry => this.getFullIndustryName(industry))
									.join('、');
							}
						}

						// 主营业务
						this.mainBusinesses = data.unit_business ? data.unit_business.split(',').filter(
							Boolean) : [];

						// 营业执照
						this.licenseImage = data.license_image || '';

						// 注册时间
						this.registerDate = data.register_date || '';

						// 会员代表信息
						this.memberName = data.name || '';
						this.memberPosition = data.rela_position || '';
						this.memberGender = data.sex || '男'; // 默认为男
						this.memberPhone = data.phone ? String(data.phone) : '';
						// 籍贯
						if (data.place) {

							// 尝试精确匹配
							let provinceIndex = this.provinceList.findIndex(item => item === data.place);

							// 如果精确匹配失败,尝试部分匹配
							if (provinceIndex === -1) {
								provinceIndex = this.provinceList.findIndex(item =>
									item.includes(data.place) || data.place.includes(item)
								);
							}

							if (provinceIndex !== -1) {
								this.homeTownIndex = provinceIndex;
								this.selectedProvince = this.provinceList[provinceIndex];
							} else {}
						}

						// 头像和证件照
						this.avatarImage = data.avatar || '';
						this.memberIdCard = data.IDcard || '';
						this.idCardFrontImage = data.card_one_image || '';
						this.idCardBackImage = data.card_tow_image || '';

						// 联系人信息
						this.contactName = data.rela_name || '';
						this.contactPhone = data.rela_phone ? String(data.rela_phone) : '';
						this.contactPosition = data.rela_position || '';
					}
				}).catch(err => {
					console.error('获取用户详情失败', err);
				});
			},

			// 根据ID获取行业名称的辅助方法 - 不再使用
			getIndustryNameById(id) {
				if (!id) return '';

				// 遍历行业列表查找名称
				for (const industry of this.industryList || []) {
					if (industry.id === id) {
						return industry.name || industry.title || '';
					}
					if (industry.children && industry.children.length > 0) {
						for (const child of industry.children) {
							if (child.id === id) {
								return child.name || child.title || '';
							}
						}
					}
				}
				return '';
			},

			// 在行业数据加载完成后处理待处理的行业ID
			processPendingIndustryIds() {
				// 检查是否有待处理的行业ID
				if (this.pendingIndustryIds && this.pendingIndustryOneIds && this.industryList && this.industryList
					.length > 0) {
					console.log('处理待处理的行业ID数据');

					// 将返回的ID转为数组
					const industryIds = this.pendingIndustryIds.split(',').map(id => parseInt(id));
					const industryOneIds = this.pendingIndustryOneIds.split(',').map(id => parseInt(id));

					// 临时存储选中的行业
					let tempSelectedIndustries = [];

					// 遍历一级行业ID
					industryOneIds.forEach(parentId => {
						// 找到对应的一级行业
						const parentIndustry = this.industryList.find(industry => industry.id === parentId);

						if (parentIndustry && parentIndustry.children) {
							// 遍历二级行业ID
							industryIds.forEach(childId => {
								// 在该一级行业的子行业中查找
								const childIndustry = parentIndustry.children.find(child => child.id ===
									childId);

								if (childIndustry) {
									// 构建完整的行业数据
									tempSelectedIndustries.push({
										...childIndustry,
										parentId: parentIndustry.id,
										parentName: parentIndustry.name
									});
								}
							});
						}
					});

					// 更新选中的行业数据
					this.selectedIndustryData = tempSelectedIndustries;

					// 更新显示文本
					if (tempSelectedIndustries.length > 0) {
						this.selectedIndustry = tempSelectedIndustries
							.map(industry => this.getFullIndustryName(industry))
							.join('、');
					}

					// 清空待处理数据
					this.pendingIndustryIds = null;
					this.pendingIndustryOneIds = null;
				}
			},

			// 判断指定步骤是否已完成
			isStepCompleted(step) {
				// 添加调试日志

				let result = false;

				switch (step) {
					case 0: // 申请信息
						// 申请职务是必填项
						result = this.selectedPosition !== null;
						break;

					case 1: // 单位信息
						// 单位名称、单位类别、所属行业、主营业务、营业执照、注册时间都是必填项
						result = Boolean(this.companyName) &&
							Boolean(this.selectedCompanyType) &&
							Boolean(this.selectedIndustry) &&
							Boolean(this.mainBusinesses.length > 0) &&
							Boolean(this.licenseImage) &&
							Boolean(this.registerDate);

						break;

					case 2: // 会员代表信息
						// 姓名、单位职务、手机号码、籍贯、头像风采照、证件号码、证件照都是必填项
						result = Boolean(this.memberName) &&
							Boolean(this.memberPosition) &&
							Boolean(this.memberPhone) &&
							Boolean(this.selectedProvince) &&
							Boolean(this.avatarImage) &&
							Boolean(this.memberIdCard) &&
							Boolean(this.idCardFrontImage) &&
							Boolean(this.idCardBackImage);

						break;

					case 3: // 联系人信息
						// 姓名、手机号码、单位职务都是必填项
						result = Boolean(this.contactName) &&
							Boolean(this.contactPhone) &&
							Boolean(this.contactPosition);

						break;

					default:
						result = false;
						break;
				}

				return result;
			},

			// 验证步骤是否已完成（用于显示图标）
			validateStep(step) {
				try {
					switch (step) {
						case 0: // 申请信息
							// 申请职务是必填项
							return !!this.selectedPosition;

						case 1: // 单位信息
							// 单位名称、单位类别、所属行业、主营业务、营业执照、注册时间都是必填项
							return !!this.companyName &&
								!!this.selectedCompanyType &&
								!!this.selectedIndustry &&
								(this.mainBusinesses && this.mainBusinesses.length > 0) &&
								!!this.licenseImage &&
								!!this.registerDate;

						case 2: // 会员代表信息
							// 姓名、单位职务、手机号码、籍贯、头像风采照、证件号码、证件照都是必填项
							return !!this.memberName &&
								!!this.memberPosition &&
								!!this.memberPhone &&
								!!this.selectedProvince &&
								!!this.avatarImage &&
								!!this.memberIdCard &&
								!!this.idCardFrontImage &&
								!!this.idCardBackImage;

						case 3: // 联系人信息
							// 姓名、手机号码、单位职务都是必填项
							return !!this.contactName &&
								!!this.contactPhone &&
								!!this.contactPosition;

						default:
							return false;
					}
				} catch (error) {
					return false;
				}
			},

			// 初始化行业选择器数据
			initIndustryPicker() {
				// 设置第一列数据（一级行业）
				this.industryArray[0] = this.industryList;
				// 设置第二列数据（二级行业，默认显示第一个一级行业的子行业）
				if (this.industryList.length > 0) {
					this.industryArray[1] = this.industryList[0].children;
				}
			},

			// 行业选择器列变化事件
			onIndustryColumnChange(e) {
				const column = e.detail.column;
				const value = e.detail.value;

				// 如果第一列变化，需要更新第二列的数据
				if (column === 0) {
					this.industryIndexes = [value, 0]; // 重置第二列的选中项
					// 更新第二列数据
					this.$set(this.industryArray, 1, this.industryList[value].children);
				} else {
					this.industryIndexes[1] = value;
				}

				// 强制更新视图
				this.$forceUpdate();
			},

			// 行业选择器确认选择事件
			onIndustryChange(e) {
				const values = e.detail.value;
				const firstIndex = values[0];
				const secondIndex = values[1];

				// 获取选中的一级和二级行业
				const firstLevel = this.industryList[firstIndex];
				const secondLevel = firstLevel.children[secondIndex];

				// 设置选中的行业显示文本
				this.selectedIndustry = `${firstLevel.name} - ${secondLevel.name}`;

				// 保存选中的行业数据
				this.selectedIndustryData = {
					firstLevel: {
						id: firstLevel.id,
						name: firstLevel.name
					},
					secondLevel: {
						id: secondLevel.id,
						name: secondLevel.name
					}
				};
			},

			// 切换到指定步骤
			switchStep(stepIndex) {
				// 只允许切换到已完成的步骤或下一个步骤
				// if (stepIndex <= this.currentStep + 1) {
				// 	this.currentStep = stepIndex;
				// }
				this.currentStep = stepIndex;
			},

			// 下一步
			nextStep() {
				// 如果是最后一步，则提交审核
				if (this.currentStep === 3) {
					this.submitForm();
					return;
				}

				// 验证当前步骤的数据
				if (this.validateCurrentStep()) {
					// 保存到缓存，但不显示提示
					this.saveToCache(false);
					// 进入下一步
					this.currentStep++;
				}
			},

			// 验证当前步骤的数据
			validateCurrentStep() {
				switch (this.currentStep) {
					case 0: // 申请信息
						if (!this.selectedPosition) {
							uni.showToast({
								title: '请选择申请职务',
								icon: 'none'
							});
							return false;
						}
						return true;

					case 1: // 单位信息
						if (!this.companyName) {
							uni.showToast({
								title: '请输入单位名称',
								icon: 'none'
							});
							return false;
						}
						if (!this.selectedCompanyType) {
							uni.showToast({
								title: '请选择单位类别',
								icon: 'none'
							});
							return false;
						}
						if (!this.selectedIndustry) {
							uni.showToast({
								title: '请选择所属行业',
								icon: 'none'
							});
							return false;
						}
						if (this.mainBusinesses.length === 0) {
							uni.showToast({
								title: '请添加主营业务',
								icon: 'none'
							});
							return false;
						}
						if (!this.licenseImage) {
							uni.showToast({
								title: '请上传营业执照',
								icon: 'none'
							});
							return false;
						}
						if (!this.registerDate) {
							uni.showToast({
								title: '请选择注册时间',
								icon: 'none'
							});
							return false;
						}
						return true;

					case 2: // 会员代表信息
						if (!this.memberName) {
							uni.showToast({
								title: '请输入姓名',
								icon: 'none'
							});
							return false;
						}
						if (!this.memberPosition) {
							uni.showToast({
								title: '请输入单位职务',
								icon: 'none'
							});
							return false;
						}
						if (!this.memberPhone) {
							uni.showToast({
								title: '请输入手机号码',
								icon: 'none'
							});
							return false;
						}
						if (!/^1\d{10}$/.test(this.memberPhone)) {
							uni.showToast({
								title: '手机号码格式不正确',
								icon: 'none'
							});
							return false;
						}
						if (!this.selectedProvince) {
							uni.showToast({
								title: '请选择籍贯',
								icon: 'none'
							});
							return false;
						}
						if (!this.avatarImage) {
							uni.showToast({
								title: '请上传头像风采照',
								icon: 'none'
							});
							return false;
						}
						if (!this.memberIdCard) {
							uni.showToast({
								title: '请输入证件号码',
								icon: 'none'
							});
							return false;
						}
						if (!this.idCardFrontImage) {
							uni.showToast({
								title: '请上传身份证人像面',
								icon: 'none'
							});
							return false;
						}
						if (!this.idCardBackImage) {
							uni.showToast({
								title: '请上传身份证国徽面',
								icon: 'none'
							});
							return false;
						}
						return true;

					case 3: // 联系人信息
						// if (!this.contactName) {
						// 	uni.showToast({
						// 		title: '请输入联系人姓名',
						// 		icon: 'none'
						// 	});
						// 	return false;
						// }
						// if (!this.contactPhone) {
						// 	uni.showToast({
						// 		title: '请输入联系人手机号码',
						// 		icon: 'none'
						// 	});
						// 	return false;
						// }
						// if (!/^1\d{10}$/.test(this.contactPhone)) {
						// 	uni.showToast({
						// 		title: '联系人手机号码格式不正确',
						// 		icon: 'none'
						// 	});
						// 	return false;
						// }
						// if (!this.contactPosition) {
						// 	uni.showToast({
						// 		title: '请输入联系人单位职务',
						// 		icon: 'none'
						// 	});
						// 	return false;
						// }
						return true;
				}
				return true;
			},

			// 提交表单
			submitForm() {
				// 验证最后一步数据
				if (!this.validateCurrentStep()) {
					return;
				}

				// 收集所有数据
				const formData = this.formData;

				// 打印数据
				console.log('提交的表单数据:', formData);

				// 调用API提交数据
				uni.showLoading({
					title: '提交中...',
					mask: true
				});

				// 去重处理行业ID数据
				const uniqueIds = Array.from(new Set(formData.industryData.map(item => item.id)));
				const uniqueParentIds = Array.from(new Set(formData.industryData.map(item => item.parentId)));

				let industry_ids = uniqueIds.join(',') || '';
				let industry_one_ids = uniqueParentIds.join(',') || '';

				comSaveUser({
					id: this.id,
					need: formData.requiredResources.join(','), // 需求资源
					supply: formData.providedResources.join(','), //提供的资源
					unit: formData.companyName, //单位名称
					industry_ids: industry_ids, //所属行业二级id
					industry_one_ids: industry_one_ids, //所属行业一级id
					unit_industry: formData.companyType, //单位类别
					unit_business: formData.mainBusinesses.join(','), //主营业务
					license_image: formData.licenseImage, //营业执照
					register_date: formData.registerDate, //注册时间
					name: formData.memberName, //姓名
					position_id: this.selectedPosition ? this.selectedPosition.id : '', //职位id
					sex: formData.memberGender, // 性别  '女','男'
					phone: formData.memberPhone, //手机号
					place: formData.homeTown, //籍贯
					avatar: formData.avatarImage, //头像
					IDcard: formData.memberIdCard, //身份证
					card_one_image: formData.idCardFrontImage, //身份证图片（头像）
					card_tow_image: formData.idCardBackImage, //身份证图片（背面）
					rela_name: formData.contactName, //联系人姓名
					rela_phone: formData.contactPhone, //联系人手机号
					rela_position: formData.contactPosition, //联系人职务
					com_id: this.chamberObj.id,
				}).then(res => {
					uni.hideLoading();

					if (res.status == 200) {
						// 显示提交成功提示
						uni.showModal({
							title: '提交成功',
							content: '您的入会申请已提交，请等待审核',
							showCancel: false,
							success: () => {
								// 清除缓存
								uni.removeStorageSync(this.cacheKey);
								// 返回上一页
								uni.navigateBack();
							}
						});
					} else {

					}

				}).catch(err => {
					uni.hideLoading();
					uni.showModal({
						title: '提交失败',
						content: err || '请检查网络或稍后重试',
						showCancel: false
					});
				});
			},

			// 保存到缓存
			saveToCache(showToast = true) {
				try {
					uni.setStorageSync(this.cacheKey, JSON.stringify(this.formData));
					if (showToast) {
						uni.showToast({
							title: '已暂存数据',
							icon: 'none',
							duration: 2000
						});
					}
					console.log('已保存表单数据到缓存:', this.formData);
				} catch (e) {
					console.error('保存缓存失败:', e);
					if (showToast) {
						uni.showToast({
							title: '保存失败',
							icon: 'none',
							duration: 2000
						});
					}
				}
			},

			// 从缓存加载数据
			loadFromCache() {
				try {
					const cachedData = uni.getStorageSync(this.cacheKey);
					if (cachedData) {
						const data = JSON.parse(cachedData);

						// 申请信息
						if (data.position) {
							const posIndex = this.positionList.findIndex(item => item.name === data.position);
							if (posIndex !== -1) {
								this.positionIndex = posIndex;
								this.selectedPosition = this.positionList[posIndex];
							}
						}
						this.requiredResources = data.requiredResources || [];
						this.providedResources = data.providedResources || [];

						// 单位信息
						this.companyName = data.companyName || '';
						if (data.companyType) {
							const typeIndex = this.companyTypeList.findIndex(item => item.name === data.companyType);
							if (typeIndex !== -1) {
								this.companyTypeIndex = typeIndex;
								this.selectedCompanyType = this.companyTypeList[typeIndex];
							}
						}

						// 恢复行业选择
						if (data.industryData) {
							this.selectedIndustry = data.industry || '';
							this.selectedIndustryData = data.industryData;

							// 恢复行业选择器的索引
							const firstLevelIndex = this.industryList.findIndex(item => item.id === data.industryData
								.firstLevel.id);
							if (firstLevelIndex !== -1) {
								this.industryIndexes[0] = firstLevelIndex;
								this.industryArray[1] = this.industryList[firstLevelIndex].children;

								const secondLevelIndex = this.industryList[firstLevelIndex].children.findIndex(
									item => item.id === data.industryData.secondLevel.id
								);
								if (secondLevelIndex !== -1) {
									this.industryIndexes[1] = secondLevelIndex;
								}
							}
						}

						this.mainBusinesses = data.mainBusinesses || [];
						this.licenseImage = data.licenseImage || '';
						this.registerDate = data.registerDate || '';

						// 会员代表信息
						this.memberName = data.memberName || '';
						this.memberPosition = data.memberPosition || '';
						this.memberGender = data.memberGender || '男';
						this.memberPhone = data.memberPhone || '';
						if (data.homeTown) {
							const provinceIndex = this.provinceList.findIndex(item => item === data.homeTown);
							if (provinceIndex !== -1) {
								this.homeTownIndex = provinceIndex;
								this.selectedProvince = this.provinceList[provinceIndex];
							}
						}
						this.avatarImage = data.avatarImage || '';
						this.memberIdCard = data.memberIdCard || '';
						this.idCardFrontImage = data.idCardFrontImage || '';
						this.idCardBackImage = data.idCardBackImage || '';

						// 联系人信息
						this.contactName = data.contactName || '';
						this.contactPhone = data.contactPhone || '';
						this.contactPosition = data.contactPosition || '';
					}
				} catch (e) {
					console.error('加载缓存失败:', e);
				}
			},

			// 上一步
			prevStep() {
				if (this.currentStep > 0) {
					this.currentStep--;
				}
			},

			// Picker选择器变化事件
			onPositionChange(e) {
				const index = e.detail.value;
				this.positionIndex = index;
				this.selectedPosition = this.positionList[index];
			},

			// 显示添加资源弹窗
			showAddResourceDialog(type) {
				this.currentResourceType = type;
				this.resourceInput = '';
				this.showResourceDialog = true;
			},

			// 取消添加资源
			cancelAddResource() {
				this.showResourceDialog = false;
			},

			// 确认添加资源
			confirmAddResource() {
				if (!this.resourceInput.trim()) {
					uni.showToast({
						title: '请输入内容',
						icon: 'none'
					});
					return;
				}

				// 根据不同类型添加到不同的数组
				switch (this.currentResourceType) {
					case '需求资源':
						this.requiredResources.push(this.resourceInput.trim());
						break;
					case '可提供的资源':
						this.providedResources.push(this.resourceInput.trim());
						break;
					case '所属行业':
						this.industries.push(this.resourceInput.trim());
						break;
					case '主营业务':
						this.mainBusinesses.push(this.resourceInput.trim());
						break;
				}

				this.showResourceDialog = false;
				this.resourceInput = '';
			},

			// 删除资源
			deleteResource(type, index) {
				switch (type) {
					case '需求资源':
						this.requiredResources.splice(index, 1);
						break;
					case '可提供的资源':
						this.providedResources.splice(index, 1);
						break;
					case '所属行业':
						this.industries.splice(index, 1);
						break;
					case '主营业务':
						this.mainBusinesses.splice(index, 1);
						break;
				}
			},

			// 选择单位类型
			onCompanyTypeChange(e) {
				const index = e.detail.value;
				this.companyTypeIndex = index;
				this.selectedCompanyType = this.companyTypeList[index];
			},

			// 选择籍贯
			onHomeTownChange(e) {
				const index = e.detail.value;
				this.homeTownIndex = index;
				this.selectedProvince = this.provinceList[index];
			},

			// 选择注册时间
			onRegisterDateChange(e) {
				this.registerDate = e.detail.value;
			},

			// 上传营业执照
			uploadLicense() {
				this.$util.uploadImageOne({
					url: 'upload/image', // 根据实际接口地址调整
					name: 'file'
				}, (res) => {
					// 上传成功回调
					if (res && res.data && res.data.path) {
						this.licenseImage = res.data.path;
						uni.showToast({
							title: '上传成功',
							icon: 'success'
						});
					}
				}, (err) => {
					// 上传失败回调
					uni.showToast({
						title: '上传失败',
						icon: 'none'
					});
				});
			},

			// 删除营业执照
			deleteLicense() {
				uni.showModal({
					title: '提示',
					content: '确定要删除营业执照吗？',
					success: (res) => {
						if (res.confirm) {
							this.licenseImage = '';
							uni.showToast({
								title: '已删除',
								icon: 'success'
							});
						}
					}
				});
			},

			// 预览图片
			previewImage(url) {
				uni.previewImage({
					urls: [url],
					current: url
				});
			},

			// 上传头像风采照
			uploadAvatar() {
				this.$util.uploadImageOne({
					url: 'upload/image', // 根据实际接口地址调整
					name: 'file'
				}, (res) => {
					// 上传成功回调
					if (res && res.data && res.data.path) {
						this.avatarImage = res.data.path;
						uni.showToast({
							title: '上传成功',
							icon: 'success'
						});
					}
				}, (err) => {
					// 上传失败回调
					uni.showToast({
						title: '上传失败',
						icon: 'none'
					});
				});
			},

			// 删除头像风采照
			deleteAvatar() {
				uni.showModal({
					title: '提示',
					content: '确定要删除头像风采照吗？',
					success: (res) => {
						if (res.confirm) {
							this.avatarImage = '';
							uni.showToast({
								title: '已删除',
								icon: 'success'
							});
						}
					}
				});
			},

			// 上传身份证人像面
			uploadIdCardFront() {
				this.$util.uploadImageOne({
					url: 'upload/image', // 根据实际接口地址调整
					name: 'file'
				}, (res) => {
					// 上传成功回调
					if (res && res.data && res.data.path) {
						this.idCardFrontImage = res.data.path;
						uni.showToast({
							title: '上传成功',
							icon: 'success'
						});
					}
				}, (err) => {
					// 上传失败回调
					uni.showToast({
						title: '上传失败',
						icon: 'none'
					});
				});
			},

			// 删除身份证人像面
			deleteIdCardFront() {
				uni.showModal({
					title: '提示',
					content: '确定要删除身份证人像面照片吗？',
					success: (res) => {
						if (res.confirm) {
							this.idCardFrontImage = '';
							uni.showToast({
								title: '已删除',
								icon: 'success'
							});
						}
					}
				});
			},

			// 上传身份证国徽面
			uploadIdCardBack() {
				this.$util.uploadImageOne({
					url: 'upload/image', // 根据实际接口地址调整
					name: 'file'
				}, (res) => {
					// 上传成功回调
					if (res && res.data && res.data.path) {
						this.idCardBackImage = res.data.path;
						uni.showToast({
							title: '上传成功',
							icon: 'success'
						});
					}
				}, (err) => {
					// 上传失败回调
					uni.showToast({
						title: '上传失败',
						icon: 'none'
					});
				});
			},

			// 删除身份证国徽面
			deleteIdCardBack() {
				uni.showModal({
					title: '提示',
					content: '确定要删除身份证国徽面照片吗？',
					success: (res) => {
						if (res.confirm) {
							this.idCardBackImage = '';
							uni.showToast({
								title: '已删除',
								icon: 'success'
							});
						}
					}
				});
			},

			// 切换标签页
			switchTab(tabIndex) {
				this.activeTab = tabIndex;
				this.currentSecondLevelOptions = this.industryList[this.industryIndexes[0]].children;
			},

			// 选择一级行业
			selectFirstLevelIndustry(industry, index) {
				this.industryIndexes = [index, 0];
				this.currentSecondLevelOptions = industry.children;
				this.activeTab = 1; // 切换到二级行业标签
			},

			// 选择二级行业
			toggleIndustrySelection(industry) {
				// 检查行业是否已被选择
				const isSelected = this.isIndustrySelected(industry);

				// 如果已选择，则移除
				if (isSelected) {
					this.tempSelectedIndustries = this.tempSelectedIndustries.filter(item => item.id !== industry.id);
					return; // 移除后直接返回
				}

				// 如果未选择且未达到最大选择数量，则添加
				if (this.tempSelectedIndustries.length < 3) {
					// 构建完整的行业数据
					const parentIndustry = this.industryList[this.industryIndexes[0]];
					const industryWithParent = {
						...industry,
						parentId: parentIndustry.id,
						parentName: parentIndustry.name
					};

					this.tempSelectedIndustries.push(industryWithParent);
				} else {
					// 达到最大选择数量，给出提示
					uni.showToast({
						title: '最多只能选择3个行业',
						icon: 'none'
					});
				}
			},

			// 判断行业是否已选择
			isIndustrySelected(industry) {
				return this.tempSelectedIndustries.some(item => item.id === industry.id);
			},

			// 获取完整行业名称
			getFullIndustryName(industry) {
				return industry.parentName ? `${industry.parentName} - ${industry.name}` : industry.name;
			},

			// 移除已选择行业
			removeFromTempSelected(index) {
				this.tempSelectedIndustries.splice(index, 1);
			},

			// 取消行业选择
			cancelIndustrySelector() {
				this.showIndustryDialog = false;
			},

			// 确认行业选择
			confirmIndustrySelection() {
				if (this.tempSelectedIndustries.length === 0) {
					uni.showToast({
						title: '请至少选择一个行业',
						icon: 'none'
					});
					return;
				}

				// 保存选中的行业数据
				this.selectedIndustryData = this.tempSelectedIndustries;

				// 更新显示文本
				this.selectedIndustry = this.tempSelectedIndustries
					.map(industry => this.getFullIndustryName(industry))
					.join('、');

				console.log('保存选中的行业数据+++', this.tempSelectedIndustries)
				console.log('更新显示文本+++', this.tempSelectedIndustries)
				this.showIndustryDialog = false;
			},

			// 显示行业选择弹窗
			// showIndustryDialog() {
			// 	// 初始化行业选择相关数据
			// 	this.activeTab = 0;
			// 	this.currentSecondLevelOptions = this.industryList[this.industryIndexes[0]].children;
			// 	this.tempSelectedIndustries = this.selectedIndustryData ? [...this.selectedIndustryData] : [];
			// 	this.showIndustryDialog = true;
			// },

			// 打开行业选择弹窗
			openIndustryDialog() {
				// this.showIndustryDialog();
			},

			// 清除已选择行业
			clearSelectedIndustry() {
				this.selectedIndustry = '';
				this.selectedIndustryData = null;
				this.tempSelectedIndustries = [];
				uni.showToast({
					title: '已清除选择行业',
					icon: 'success'
				});
			},

			// 移除已选择行业
			removeSelectedIndustry(index) {
				if (!this.selectedIndustryData || !Array.isArray(this.selectedIndustryData)) {
					return;
				}
				// 移除特定索引的行业
				this.selectedIndustryData.splice(index, 1);

				// 如果全部移除，则清空选择
				if (this.selectedIndustryData.length === 0) {
					this.selectedIndustry = '';
					this.selectedIndustryData = null;
				} else {
					// 更新显示文本
					this.selectedIndustry = this.selectedIndustryData
						.map(industry => this.getFullIndustryName(industry))
						.join('、');
				}
			},
		},
	};
</script>

<style scoped lang="css">
	.ml-11-5 {
		margin-left: 23rpx;
	}

	.ml-6-5 {
		margin-left: 13rpx;
	}

	.mt-5 {
		margin-top: 10rpx;
	}

	.mt-13 {
		margin-top: 26rpx;
	}

	.ml-5 {
		margin-left: 10rpx;
	}

	.mt-13-5 {
		margin-top: 27rpx;
	}

	.ml-5-5 {
		margin-left: 11rpx;
	}

	.mt-8-5 {
		margin-top: 17rpx;
	}

	.mt-42-5 {
		margin-top: 85rpx;
	}

	.ml-21-5 {
		margin-left: 43rpx;
	}

	.page {
		background-color: #F7F7F7;
		min-height: 100vh;
		padding-bottom: 150rpx;
	}

	.section_2 {
		padding-left: 25rpx;
		background-color: #ffffff;
		height: 269rpx;
	}

	.text {
		margin-left: 24rpx;
		color: #000000;
		font-size: 30rpx;
		font-family: SourceHanSansCN;
		line-height: 22.76rpx;
		letter-spacing: -0.6rpx;
	}

	.text_2 {
		margin-left: 12rpx;
		margin-top: 54rpx;
		color: #333333;
		font-size: 36rpx;
		font-family: SourceHanSansCN;
		line-height: 33.08rpx;
	}

	.group_2 {
		margin-top: 62rpx;
	}

	.group_3 {
		padding-bottom: 18rpx;
	}

	.image_6 {
		width: 36rpx;
		height: 36rpx;
	}

	.font {
		font-size: 26rpx;
		font-family: SourceHanSansCN;
		line-height: 23.9rpx;
		color: #666666;
	}

	.text_3 {
		margin-left: 8rpx;
		line-height: 24.48rpx;
	}

	.image_7 {
		margin-left: 20rpx;
	}

	.text_4 {
		margin-left: 8rpx;
		color: #c50415;
		line-height: 24.26rpx;
	}

	.image_8 {
		margin-right: 2rpx;
		width: 137rpx;
		height: 9rpx;
	}

	.group {
		margin-right: -49rpx;
		margin-top: -49rpx;
	}

	.section {
		background-color: #ff573333;
		filter: blur(30rpx);
		border-radius: 50%;
		width: 318rpx;
		height: 318rpx;
	}

	.section_3 {
		background-color: #ff26260a;
		filter: blur(30rpx);
		border-radius: 50%;
		width: 230rpx;
		height: 230rpx;
	}

	.pos {
		position: absolute;
		left: 0;
		top: 74rpx;
	}

	.section_4 {
		padding: 11rpx 25rpx 14rpx;
		background-color: #ffffff99;
		border-radius: 50rpx;
		width: 174rpx;
		border-left: solid 1rpx #97979733;
		border-right: solid 1rpx #97979733;
		border-top: solid 1rpx #97979733;
		border-bottom: solid 1rpx #97979733;
	}

	.pos_5 {
		position: absolute;
		right: 61rpx;
		top: 149rpx;
	}

	.image-wrapper {
		width: 37rpx;
	}

	.image_5 {
		width: 37rpx;
		height: 13rpx;
	}

	.section_5 {
		background-color: #00000033;
		width: 1rpx;
		height: 37rpx;
	}

	.image_4 {
		width: 34rpx;
		height: 34rpx;
	}

	.image_3 {
		width: 49rpx;
		height: 22.68rpx;
	}

	.pos_4 {
		position: absolute;
		right: 77.34rpx;
		top: 83.68rpx;
	}

	.image_2 {
		width: 31rpx;
		height: 22rpx;
	}

	.pos_3 {
		position: absolute;
		right: 136rpx;
		top: 83.66rpx;
	}

	.image {
		width: 34rpx;
		height: 21rpx;
	}

	.pos_2 {
		position: absolute;
		right: 177rpx;
		top: 84.32rpx;
	}

	.pos_6 {
		position: absolute;
		left: 16.68rpx;
		bottom: 27rpx;
	}

	.text_5 {
		line-height: 24.58rpx;
	}

	.pos_8 {
		position: absolute;
		left: 51.6rpx;
		bottom: 27.5rpx;
	}

	.pos_7 {
		position: absolute;
		right: 210rpx;
		bottom: 27rpx;
	}

	.text_6 {
		line-height: 24.68rpx;
	}

	.pos_9 {
		position: absolute;
		right: 72.12rpx;
		bottom: 27.4rpx;
	}

	.section_6 {
		margin: 20rpx 20rpx 0;
		background-color: #ffffff;
		border-radius: 20rpx;
	}

	.group_4 {
		padding: 33rpx 0 30rpx;
	}

	.image_9 {
		width: 8rpx;
		height: 28rpx;
	}

	.font_2 {
		font-size: 32rpx;
		font-family: SourceHanSansCN;
		line-height: 29.58rpx;
		color: #000000;
	}

	.text_7 {
		line-height: 30.14rpx;
	}

	.divider {
		background-image: repeating-linear-gradient(90deg, #00000080, #00000080 0.28%, transparent 0.28%, transparent 0.562%);
		background-position: -1rpx 0rpx;
		height: 0.5rpx;
	}

	.group_5 {
		padding: 20rpx 10rpx 24rpx;
	}

	.section_7 {
		padding: 30rpx 20rpx 30rpx 22rpx;
		background-color: #ffffff;
		border-radius: 10rpx 10rpx 0rpx 0rpx;
	}

	.view {
		margin: 0 6rpx;
	}

	.group_7 {
		line-height: 29.46rpx;
		height: 29.46rpx;
	}

	.font_3 {
		font-size: 32rpx;
		font-family: SourceHanSansCN;
		line-height: 10.4rpx;
		color: #c50415;
	}

	.font_4 {
		font-size: 32rpx;
		font-family: SourceHanSansCN;
		line-height: 29.58rpx;
		color: #333333;
	}

	.text_8 {
		line-height: 29.46rpx;
	}

	.group_6 {
		padding: 14rpx 9rpx 14rpx 12rpx;
		border-radius: 6rpx;
		height: 61rpx;
		border-left: solid 1rpx #999;
		border-right: solid 1rpx #999;
		border-top: solid 1rpx #999;
		border-bottom: solid 1rpx #999;
	}

	.font_5 {
		font-size: 32rpx;
		font-family: SourceHanSansCN;
		line-height: 29.58rpx;
		color: #666666;
	}

	.text_9 {
		line-height: 29.44rpx;
	}

	.image_10 {
		width: 32rpx;
		height: 32rpx;
	}

	.section_8 {
		padding: 30rpx 22rpx 8rpx;
		background-color: #ffffff;
		border-top: solid 0.5rpx #00000026;
	}

	.text_10 {
		line-height: 29.44rpx;
	}

	.group_8 {
		padding: 14rpx 10rpx;
		border-radius: 6rpx;
		height: 59rpx;
	}

	.font_6 {
		font-size: 32rpx;
		font-family: SourceHanSansCN;
		line-height: 29.58rpx;
		color: #2a82e4;
	}

	.text_11 {
		line-height: 29.06rpx;
	}

	.section_9 {
		padding: 10rpx 0 20rpx;
		background-color: #ffffff;
	}

	.section_10 {
		background-color: #f2f2f2;
		border-radius: 6rpx;
		height: 209.4rpx;
		overflow-y: auto;
	}

	.view_2 {
		margin: 0 25rpx;
	}

	.text_12 {
		line-height: 29.62rpx;
	}

	.section_11 {
		padding: 10rpx 25rpx 20rpx;
		background-color: #ffffff;
	}

	.text_13 {
		color: #666666;
		font-size: 20rpx;
		font-family: SourceHanSansCN;
		line-height: 24rpx;
		width: 100%;
	}

	.divider_2 {
		background-image: repeating-linear-gradient(90deg, #00000080, #00000080 0.28%, transparent 0.28%, transparent 0.561%);
		background-position: -1rpx 0rpx;
		height: 0.5rpx;
	}

	.group_9 {
		padding: 20rpx 10rpx 42rpx;
	}

	.view_3 {
		padding: 40rpx 18rpx 30rpx;
		background-color: #ffffff;
		border-radius: 10rpx 10rpx 0rpx 0rpx;
	}

	.group_10 {
		margin-left: 2rpx;
		line-height: 29.7rpx;
	}

	.text_14 {
		line-height: 29.7rpx;
	}

	.text-wrapper {
		padding: 16rpx 0 12rpx;
		border-radius: 6rpx;
		border-left: solid 1rpx #999;
		border-right: solid 1rpx #999;
		border-top: solid 1rpx #999;
		border-bottom: solid 1rpx #999;
	}

	.text_15 {
		margin-left: 22rpx;
		line-height: 29.54rpx;
	}

	.view_4 {
		margin: 0 6rpx;
	}

	.group_11 {
		line-height: 29.78rpx;
		height: 29.78rpx;
	}

	.font_7 {
		font-size: 32rpx;
		font-family: SourceHanSansCN;
		line-height: 10.4rpx;
		color: #ff0000;
	}

	.text_16 {
		line-height: 29.78rpx;
	}

	.group_12 {
		line-height: 29.58rpx;
		height: 29.58rpx;
	}

	.section_12 {
		margin: 0 25rpx;
		background-color: #f2f2f2;
		border-radius: 6rpx;
		height: 160rpx;
		overflow-y: auto;
	}

	.group_13 {
		padding: 30rpx 18rpx 20rpx;
		border-top: solid 0.5rpx #00000026;
	}

	.group_14 {
		margin-left: 2rpx;
	}

	.view_5 {
		line-height: 29.62rpx;
	}

	.text_17 {
		line-height: 29.62rpx;
	}

	.image_11 {
		width: 655rpx;
		height: 446rpx;
	}

	.group_16 {
		margin-top: 10rpx;
		line-height: 29.76rpx;
		height: 29.76rpx;
	}

	.text_18 {
		line-height: 29.76rpx;
	}

	.group_15 {
		padding: 18rpx 12rpx 16rpx;
		border-radius: 6rpx;
		height: 61rpx;
		border-left: solid 1rpx #999;
		border-right: solid 1rpx #999;
		border-top: solid 1rpx #999;
		border-bottom: solid 1rpx #999;
	}

	.text_19 {
		line-height: 24.08rpx;
	}

	.image_12 {
		border-radius: 0.68rpx;
		width: 24.68rpx;
		height: 24.68rpx;
	}

	.section_13 {
		margin: 9rpx 20rpx 0;
		padding-bottom: 36rpx;
		background-color: #ffffff;
		border-radius: 20rpx;
	}

	.text_20 {
		line-height: 30.24rpx;
	}

	.group_17 {
		padding: 20rpx 10rpx;
	}

	.view_6 {
		margin: 0 6rpx;
	}

	.group_18 {
		line-height: 29.5rpx;
		height: 29.5rpx;
	}

	.text_21 {
		line-height: 29.5rpx;
	}

	.text-wrapper_2 {
		padding: 18rpx 0 14rpx;
		border-radius: 6rpx;
		width: 351rpx;
		height: 61rpx;
		border-left: solid 1rpx #999;
		border-right: solid 1rpx #999;
		border-top: solid 1rpx #999;
		border-bottom: solid 1rpx #999;
	}

	.font_8 {
		font-size: 28rpx;
		font-family: SourceHanSansCN;
		line-height: 25.74rpx;
		color: #999999;
	}

	.text_22 {
		margin-left: 12rpx;
	}

	.view_7 {
		margin: 0 6rpx;
	}

	.group_19 {
		line-height: 29.66rpx;
		height: 29.66rpx;
	}

	.text_23 {
		line-height: 29.66rpx;
	}

	.text-wrapper_3 {
		padding: 20rpx 0 16rpx;
		border-radius: 6rpx;
		width: 351rpx;
		height: 61rpx;
		border-left: solid 1rpx #999;
		border-right: solid 1rpx #999;
		border-top: solid 1rpx #999;
		border-bottom: solid 1rpx #999;
	}

	.text_24 {
		margin-left: 10rpx;
		color: #999999;
		line-height: 23.92rpx;
	}

	.group_20 {
		padding: 10rpx;
		border-radius: 6rpx;
		height: 50rpx;
	}

	.group_21 {
		margin-left: 212rpx;
	}

	.group_22 {
		border-radius: 50%;
		width: 30rpx;
		height: 30rpx;
		border-left: solid 2rpx #999;
		border-right: solid 2rpx #999;
		border-top: solid 2rpx #999;
		border-bottom: solid 2rpx #999;
	}

	.text_25 {
		line-height: 22.54rpx;
	}

	.text_26 {
		line-height: 24.14rpx;
	}

	.view_8 {
		margin: 0 6rpx;
	}

	.group_23 {
		line-height: 29.44rpx;
		height: 29.44rpx;
	}

	.font_9 {
		font-size: 32rpx;
		font-family: SourceHanSansCN;
		line-height: 10.4rpx;
		color: #d60000;
	}

	.text_27 {
		line-height: 29.44rpx;
	}

	.text_28 {
		margin-left: 12rpx;
	}

	.view_9 {
		margin: 0 6rpx;
	}

	.view_10 {
		line-height: 29.58rpx;
	}

	.image_13 {
		width: 256rpx;
		height: 256rpx;
	}

	.group_24 {
		line-height: 29.3rpx;
		height: 29.3rpx;
	}

	.text_29 {
		line-height: 29.3rpx;
	}

	.text_30 {
		margin-left: 12rpx;
	}

	.section_14 {
		margin: 0 10rpx;
		padding: 40rpx 4rpx 8rpx 20rpx;
		background-color: #ffffff;
		border-top: solid 0.5rpx #00000026;
	}

	.group_25 {
		margin-left: 2rpx;
		line-height: 29.46rpx;
	}

	.text_31 {
		color: #c40001;
	}

	.text_32 {
		line-height: 29.46rpx;
	}

	.equal-division {
		align-self: stretch;
	}

	.image_14 {
		width: 308.26rpx;
		height: 199.8rpx;
	}

	.image-wrapper_2 {
		flex: 1 1 314.44rpx;
	}

	.equal-division-item {
		background-color: #ffffff;
		border-radius: 5.7rpx;
		height: 201.22rpx;
		border-left: dotted 0.5rpx #000000;
		border-right: dotted 0.5rpx #000000;
		border-top: dotted 0.5rpx #000000;
		border-bottom: dotted 0.5rpx #000000;
	}

	.section_15 {
		margin: 20rpx 20rpx 0;
		padding: 20rpx 0 32rpx;
		background-color: #ffffff;
		border-radius: 10rpx;
	}

	.section_16 {
		background-color: #c50415;
		border-radius: 0rpx 10rpx 10rpx 0rpx;
		width: 6rpx;
		height: 26rpx;
	}

	.text_33 {
		line-height: 30.02rpx;
	}

	.section_17 {
		margin-right: 20rpx;
		padding: 30rpx 20rpx;
		background-color: #ffffff;
		border-radius: 10rpx 10rpx 0rpx 0rpx;
	}

	.text_34 {
		margin-top: 10rpx;
	}

	.text_35 {
		line-height: 29.5rpx;
	}

	.text_36 {
		margin-left: 12rpx;
	}

	.text_37 {
		line-height: 29.44rpx;
	}

	.text_38 {
		margin-left: 12rpx;
	}

	.text_39 {
		line-height: 29.66rpx;
	}

	.text_40 {
		margin-left: 10rpx;
		line-height: 23.92rpx;
	}

	.section_18 {
		padding: 20rpx 60rpx;
		background-color: #ffffff;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 999;
		box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
	}

	.text-wrapper_4 {
		padding: 28rpx 0 24rpx;
		background-color: #0f0a00;
		border-radius: 10rpx;
		width: 181rpx;
		height: 79rpx;
		border-left: solid 1rpx #2a82e4;
		border-right: solid 1rpx #2a82e4;
		border-top: solid 1rpx #2a82e4;
		border-bottom: solid 1rpx #2a82e4;
	}

	.font_10 {
		font-size: 26rpx;
		font-family: SourceHanSansCN;
		line-height: 23.9rpx;
		color: #ffffff;
	}

	.text_41 {
		line-height: 24rpx;
	}

	.text-wrapper_5 {
		padding: 28rpx 0 24rpx;
		border-radius: 10rpx;
		width: 181rpx;
		height: 79rpx;
		border-left: solid 1rpx #2a82e4;
		border-right: solid 1rpx #2a82e4;
		border-top: solid 1rpx #2a82e4;
		border-bottom: solid 1rpx #2a82e4;
	}

	.text_42 {
		color: #2a82e4;
		line-height: 23.78rpx;
	}

	.text-wrapper_6 {
		padding: 28rpx 0 24rpx;
		background-color: #43cf7c;
		border-radius: 10rpx;
		width: 180rpx;
		height: 78rpx;
	}

	.text_43 {
		line-height: 24.22rpx;
	}

	.text_active {
		color: #c50415;
		line-height: 24.26rpx;
	}

	/* 可点击的文本样式 */
	.font {
		font-size: 26rpx;
		font-family: SourceHanSansCN;
		line-height: 23.9rpx;
		color: #666666;
		cursor: pointer;
	}

	.indicator-container {
		position: relative;
		width: 100%;
		height: 20rpx;
		margin-top: 10rpx;
	}

	.indicator-line {
		position: absolute;
		height: 6rpx;
		background-color: #c50415;
		/* 红色指示线 */
		border-radius: 3rpx;
		transition: all 0.5s ease;
		/* 平滑过渡效果 */
	}

	.safe-area-bottom {
		padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
		/* iOS 11.0 */
		padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
		/* iOS 11.2+ */
	}

	.resource-tags {
		display: flex;
		flex-wrap: wrap;
	}

	.resource-tag {
		display: flex;
		align-items: center;
		background-color: #ffffff;
		border-radius: 10rpx;
		padding: 10rpx 20rpx;
		margin: 10rpx;
		box-shadow: 0 2rpx 5rpx rgba(0, 0, 0, 0.1);
	}

	.delete-icon {
		margin-left: 10rpx;
		font-size: 28rpx;
		color: #999;
	}

	.resource-dialog {
		background-color: #fff;
		border-radius: 10rpx;
		overflow: hidden;
		width: 100%;
	}

	.resource-dialog-title {
		padding: 30rpx;
		text-align: center;
		font-size: 32rpx;
		font-weight: bold;
		border-bottom: 1rpx solid #eee;
	}

	.resource-dialog-content {
		padding: 30rpx;
		max-height: 600rpx;
		overflow-y: auto;
	}

	.resource-dialog-footer {
		display: flex;
		border-top: 1rpx solid #eee;
	}

	.resource-dialog-btn {
		flex: 1;
		text-align: center;
		padding: 25rpx 0;
		font-size: 30rpx;
	}

	.cancel-btn {
		border-right: 1rpx solid #eee;
		color: #666;
	}

	.confirm-btn {
		color: #2a82e4;
	}

	.empty-resource-hint {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100%;
		color: #999;
		font-size: 26rpx;
		padding: 20rpx;
		text-align: center;
	}

	.group_22_selected {
		background-color: #2a82e4;
		border-color: #2a82e4;
	}

	/* 营业执照上传相关样式 */
	.license-upload-container {
		position: relative;
		width: 655rpx;
		height: 446rpx;
	}

	.license-upload-btn {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background-color: #f8f8f8;
		border: 1rpx dashed #ddd;
		border-radius: 10rpx;
	}

	.upload-text {
		margin-top: 20rpx;
		font-size: 28rpx;
		color: #999;
	}

	.delete-btn {
		position: absolute;
		top: -15rpx;
		right: -15rpx;
		z-index: 10;
		background-color: #ffffff;
		border-radius: 50%;
		width: 40rpx;
		height: 40rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		box-shadow: 0 0 6rpx rgba(0, 0, 0, 0.2);
	}

	.position-relative {
		position: relative;
	}

	.industry-dialog {
		background-color: #fff;
		border-radius: 16rpx;
		overflow: hidden;
		width: 100%;
		display: flex;
		flex-direction: column;
	}

	.industry-dialog-title {
		padding: 30rpx;
		text-align: center;
		font-size: 32rpx;
		font-weight: bold;
		border-bottom: 1rpx solid #f2f2f2;
		background-color: #ffffff;
	}

	.industry-dialog-content {
		padding: 30rpx;
		max-height: 800rpx;
		overflow-y: auto;
		flex: 1;
	}

	.industry-tabs {
		display: flex;
		justify-content: space-around;
		margin-bottom: 25rpx;
		border-radius: 12rpx;
		background-color: #f7f7f7;
		padding: 8rpx;
	}

	.industry-tab {
		padding: 14rpx 30rpx;
		border-radius: 10rpx;
		font-size: 28rpx;
		color: #666;
		flex: 1;
		text-align: center;
		transition: all 0.3s ease;
	}

	.industry-tab-active {
		background-color: #2a82e4;
		color: #ffffff;
		box-shadow: 0 2rpx 6rpx rgba(42, 130, 228, 0.3);
	}

	.industry-list {
		margin-top: 15rpx;
	}

	.industry-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 22rpx 15rpx;
		border-bottom: 1rpx solid #f5f5f5;
		transition: all 0.2s ease;
	}

	.industry-item-hover {
		background-color: #f9f9f9;
	}

	.industry-item-left {
		display: flex;
		align-items: center;
	}

	.industry-checkbox {
		width: 36rpx;
		height: 36rpx;
		border: 2rpx solid #ddd;
		border-radius: 50%;
		margin-right: 15rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		transition: all 0.2s ease;
	}

	.industry-checkbox-selected {
		background-color: #2a82e4;
		border-color: #2a82e4;
		box-shadow: 0 2rpx 4rpx rgba(42, 130, 228, 0.2);
	}

	.check-icon {
		color: #ffffff;
		font-weight: bold;
		font-size: 24rpx;
	}

	.industry-name {
		font-size: 28rpx;
		color: #333;
	}

	.arrow-icon {
		width: 24rpx;
		height: 24rpx;
	}

	.selected-industries-container {
		margin-top: 25rpx;
		padding-top: 20rpx;
		border-top: 1rpx dashed #eee;
	}

	.selected-industries-title {
		font-size: 28rpx;
		color: #333;
		margin-bottom: 15rpx;
		font-weight: bold;
	}

	.selected-industries-scroll {
		max-height: 150rpx;
	}

	.selected-industries-tags {
		display: flex;
		flex-wrap: wrap;
	}

	.selected-industry-tag {
		display: flex;
		align-items: center;
		background-color: #ecf5ff;
		border-radius: 30rpx;
		padding: 10rpx 18rpx;
		margin: 6rpx;
		font-size: 24rpx;
		color: #2a82e4;
		box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
	}

	.tag-text {
		max-width: 300rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.delete-icon {
		margin-left: 8rpx;
		font-size: 28rpx;
		color: #2a82e4;
		font-weight: bold;
	}

	.industry-dialog-footer {
		padding: 20rpx;
		display: flex;
		border-top: 1rpx solid #f2f2f2;
		background-color: #ffffff;
	}

	.industry-dialog-btn {
		flex: 1;
		text-align: center;
		padding: 10rpx 0;
		font-size: 30rpx;
		transition: all 0.2s ease;
	}

	.btn-hover {
		background-color: #f7f7f7;
	}

	.cancel-btn {
		border-right: 1rpx solid #f2f2f2;
		color: #666;
	}

	.confirm-btn {
		color: #2a82e4;
		font-weight: 500;
	}

	.industry-scroll {
		max-height: 70vh;
		border-radius: 12rpx;
		background-color: #fafafa;
		padding: 0 10rpx;
	}

	.title-text {
		font-size: 32rpx;
		font-weight: bold;
		color: #000000;
	}

	.title-desc {
		font-size: 28rpx;
		color: #666666;
		margin-left: 10rpx;
	}

	.industry-select-box {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx;
		border-radius: 8rpx;
		background-color: #F2F2F2;
		min-width: 350rpx;
	}

	.industry-display {
		flex: 1;
		margin-right: 15rpx;
		max-width: 420rpx;
	}

	.industry-placeholder {
		color: #999;
		font-size: 30rpx;
	}

	.industry-selected-text {
		color: #333;
		font-size: 28rpx;
	}

	.industry-display-section {
		margin-top: 20rpx;
		padding: 20rpx;
		background-color: #ffffff;
		border-radius: 10rpx;
	}

	.industry-tag-container {
		display: flex;
		flex-wrap: wrap;
	}

	.reason-content {
		color: #666;
		font-size: 28rpx;
		padding: 10rpx 0;
		word-break: break-all;
	}

	/* 审核状态相关样式 */
	.audit-status-container {
		background-color: #FFFFFF;
		border-radius: 12rpx;
		padding: 20rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
	}

	.audit-status-box {
		display: flex;
		padding: 20rpx;
		border-radius: 8rpx;
	}

	.audit-pass {
		background-color: rgba(25, 190, 107, 0.1);
		border-left: 8rpx solid #19be6b;
	}

	.audit-reject {
		background-color: rgba(250, 53, 52, 0.1);
		border-left: 8rpx solid #fa3534;
	}

	.audit-pending {
		background-color: rgba(255, 153, 0, 0.1);
		border-left: 8rpx solid #ff9900;
	}

	.no-submit {
		background-color: rgba(144, 147, 153, 0.1);
		border-left: 8rpx solid #909399;
	}

	.status-icon {
		margin-right: 20rpx;
		display: flex;
		align-items: center;
	}

	.status-content {
		flex: 1;
	}

	.status-title {
		font-size: 32rpx;
		font-weight: bold;
		margin-bottom: 10rpx;
	}

	.status-desc {
		font-size: 28rpx;
		color: #666;
	}

	.reject-reason {
		margin-top: 20rpx;
		background-color: rgba(255, 255, 255, 0.7);
		padding: 16rpx;
		border-radius: 8rpx;
	}

	.reason-title {
		font-size: 28rpx;
		font-weight: bold;
		color: #333;
		margin-bottom: 8rpx;
	}

	.reason-content {
		font-size: 26rpx;
		color: #666;
		line-height: 1.5;
	}
</style>